package sweezy.swf.tools.abcbuilder
{
	import sweezy.swf.tools.abcbuilder.utils.ElementList;

	public class MemberDef extends ElementDef
	{

		private var _metadatas:ElementList;

		private var _name:String;

		private var _namespace:Namespace;

		public function MemberDef()
		{
			_metadatas = new ElementList();
		}

		public function addMetadata(metadata:MetadataDef):void
		{
			_metadatas.addElement(metadata);
		}

		public function getMetadata(uid:uint):MetadataDef
		{
			return _metadatas.getElementByUID(uid) as MetadataDef;
		}

		public function get metadatas():Array
		{
			return _metadatas.elements;
		}

		public function get name():String
		{
			return _name;
		}

		public function set name(value:String):void
		{
			_name = value;
		}

		public function get namespace():Namespace
		{
			return _namespace;
		}

		public function set namespace(value:Namespace):void
		{
			_namespace = value;
		}

		public function get numMetadatas():uint
		{
			return _metadatas.numElements;
		}

		public function removeMetadata(metadata:MetadataDef):void
		{
			_metadatas.removeElement(metadata);
		}
	}
}
